﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace YArchitech.Revit
{
	public class ElemInElementsFilter : ISelectionFilter
	{
		public ElemInElementsFilter(List<Element> elems)
		{
			this.elems = elems;
		}

		bool ISelectionFilter.AllowElement(Element elem)
		{
			foreach (Element element in this.elems)
			{
				if (elem.Id.IntegerValue == element.Id.IntegerValue)
				{
					return true;
				}
			}
			return false;
		}

		bool ISelectionFilter.AllowReference(Reference reference, XYZ position)
		{
			throw new NotImplementedException();
		}

		private List<Element> elems = new List<Element>();
	}
}
